﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ECRMS.Biz.Dom;
using ECRMS.Biz;
using ECRMS.Common;
using System.ServiceModel;
using System.ServiceModel.Web;

namespace ECRMS.Service
{
    [ServiceContract]
    public partial interface ICtPostService
    {
        [OperationContract]
        CtServiceResult<List<CtPost>> CtGetPosts(Guid corpId);

        [OperationContract]
        [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped)]
        CtServiceResult CtUpdatePost(CtPost post);
    }

    public partial class ECRService : ICtPostService
    {
        CtServiceResult<List<CtPost>> ICtPostService.CtGetPosts(Guid corpId)
        {
            var logic = new CtPostLogic();
            return logic.GetAllCorpPostsByCorpId(corpId);
        }

        CtServiceResult ICtPostService.CtUpdatePost(CtPost post)
        {
            var logic = new CtPostLogic();
            return logic.UpdateCorpPost(post);
        }

    }
}
